﻿
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sproc_Linkman_GetCustomLinkman]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[sproc_Linkman_GetCustomLinkman];
GO
CREATE PROCEDURE [dbo].[sproc_Linkman_GetCustomLinkman]
@id int

/*------------------------------------
功能：    得到自定义联系人
参数：    
    @id    int    :    自定义联系人id(0取出所有联系人)





----------------------------------------*/
AS
    IF(@id<>0)
        SELECT *,(case Gender when 1 then '男' else  '女' end ) as SexName  FROM UDS_Linkman_CustomLinkman
        WHERE ID=@id
    ELSE
        SELECT *,(case Gender when 1 then '男' else  '女' end ) as SexName FROM UDS_Linkman_CustomLinkman